# -*- coding: utf-8 -*-
# @Author:  leon.wu
# @Date:    2019/11/22 4:29 PM

import time
from conf import config
from utils.srf_log import logger
from utils.db import db_risk


class XyfCustomtag(object):
    def __init__(self, req_data):
        self.uid = int(req_data['uid'])
    def get_xyf_customtag(self):
        customtag = 'C'
        product_name = 'xyf'
        sql = "select customtag , product_name from xyf_customtag where uid = %s and product_name = 'xyf' order by updated_at desc  limit 1"
        values = [self.uid]
        datas = db_risk.select(sql, values, self.uid)
        for data in datas:
            customtag = data[0]
            product_name = data[1]
        logger.debug('uid:%s, customtag:%s, product_name:%s',self.uid, customtag, product_name)
        return {'customtag':customtag, 'product_name':product_name}